package com.major.dawn.serializable;


import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;

public class WriteObject {

    public static void main(String[] args) throws IOException {
        ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("object.text"));

        Person person = new Person();
        person.setName("qiaobao");
        person.setAge(26);
        oos.writeObject(person);

    }
}
